﻿using System;
using System.Collections.Generic;
using System.Text;

public sealed class PropertyBuilder : TypeBuilder {

    public TypeBuilder type;

    public IRBuilder getBody;

    public IRBuilder setBody;

    public override void write(WriteContext context) {

        if (getBody == null && setBody == null) {
            attributes |= MemberAttributes.empty;
        }

        base.write(context);

        context.writeMember(type);

        if (getBody != null || setBody != null) {
            if (getBody != null) {
                context.writeByteArrayList(getBody.output_bak);
            } else {
                context.writeInt(0);
            }

            if (setBody != null) {
                context.writeByteArrayList(setBody.output_bak);
            } else {
                context.writeInt(0);
            }
        }


    }

}